home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / picks / HTTrack / httrack-3.22-3.exe / {app} / src / swf / swf2html_cls.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-10-05  |  1.4 KB  |  64 lines

  1. /*
  2.   Flash (SWF) interface to httrack
  3.   Using the library provided by Macromedia(tm)
  4.   from http://www.macromedia.com/software/flash/download/search_engine/index.html
  5.   See swf2html_license.txt for more information on the license
  6. */
  7.  
  8. /*
  9.  
  10.   swf2html_cls.cpp
  11.   
  12. */
  13.  
  14. #include <stdio.h>
  15.  
  16. #include "swf2html_cls.h"
  17.  
  18. bool Swf2HtmlConverterCallback::ConvertSwf2Html(void* buffer, int size,
  19.                                                 void* handle, 
  20.                                                 htsmodAddLink callbackLink)
  21. {
  22.   m_callbackLink  = callbackLink;
  23.   m_buffer = (char*) buffer;
  24.   m_size = size;
  25.   m_handle = handle;
  26.   return Swf2HtmlConverter::ConvertSwf2Html();
  27. }
  28.  
  29. swf_S32 Swf2HtmlConverterCallback::ReadInput(void *buffer, swf_S32 count)
  30. {
  31.   if (m_offs > m_size)
  32.     return -1;
  33.   if (m_offs + count > m_size)
  34.     count = m_size - m_offs;
  35.   memcpy(buffer, m_buffer + m_offs, (int) count);
  36.   m_offs += count;
  37.   return count;
  38. }
  39.  
  40. void Swf2HtmlConverterCallback::PutString(const char *str)
  41. {
  42. }
  43.  
  44. void Swf2HtmlConverterCallback::PutLink(const char *str)
  45. {
  46.   m_callbackLink(m_handle, (char*) str);
  47. }
  48.  
  49. void Swf2HtmlConverterCallback::PutByte(swf_U8 ch)
  50. {
  51. }
  52.  
  53. void Swf2HtmlConverterCallback::DisplayError(const char *str)
  54. {
  55. }
  56.  
  57. Swf2HtmlConverterCallback::Swf2HtmlConverterCallback()
  58. {
  59.   m_callbackLink  = NULL;
  60.   m_buffer = NULL;
  61.   m_offs = m_size = 0;
  62.   m_handle = NULL;
  63. }
  64.